package com.zzh.takeoutapp.activity;

import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;

import com.zzh.takeoutapp.R;
import com.zzh.takeoutapp.adapter.HomeDiscountAdapter;
import com.zzh.takeoutapp.base.BaseActivity;
import com.zzh.takeoutapp.utils.DividerGridItemDecoration;
import com.zzh.takeoutapp.utils.ToolBarHelper;

import java.util.ArrayList;
import java.util.List;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * Created by Administrator on 2018/7/24.
 * 折扣商家
 */

public class HomeDiscountActivity extends BaseActivity {
    @Bind(R.id.toolbar)
    Toolbar tbToolbar;
    @Bind(R.id.recyclerView)
    RecyclerView recyclerView;
    private GridLayoutManager layoutManager;

    private HomeDiscountAdapter adapter;
    private List<String> stringList;

    @Override
    public void setContent() {
        setContentView(R.layout.activity_home_discount);
        ButterKnife.bind(this);
    }

    @Override
    public void initComponent() {
        ToolBarHelper.setTitleAndBackAndText(this, tbToolbar, "五折专送");
        layoutManager = new GridLayoutManager(this, 1);
        recyclerView.setLayoutManager(layoutManager);
        recyclerView.addItemDecoration(new DividerGridItemDecoration(this, 0, R.color.blue));
        stringList = new ArrayList<>();
        stringList.add("ce测试数据");
        stringList.add("ce测试数据");
        stringList.add("ce测试数据");
        stringList.add("ce测试数据");
        stringList.add("ce测试数据");
        adapter = new HomeDiscountAdapter(stringList);
        recyclerView.setAdapter(adapter);
    }

    @Override
    public void setListener() {

    }

    @Override
    public void onAfterInit() {

    }
}
